package com.zs.blog.exception;

import com.zs.blog.constant.enums.ResponseResultEnum;
import lombok.Getter;

/**
 * @Title: BizException
 * @Author zs
 * @Package com.zs.blog.exception
 * @Date 2024/11/26 0:06
 * @description: 业务异常
 */
@Getter
public class BusinessException extends RuntimeException{

    private Integer code = ResponseResultEnum.FAILURE.getCode();
    private final String message;

    public BusinessException(String message){
        this.message = message;
    }

    public BusinessException(ResponseResultEnum responseResultEnum){
        this.code = responseResultEnum.getCode();
        this.message = responseResultEnum.getMessage();
    }

}
